import 'package:enjoy_plan/locale/app_localizations_delegate.dart';
import 'package:enjoy_plan/page/custom_page_1.dart';
import 'package:enjoy_plan/page/custom_page_2.dart';
import 'package:enjoy_plan/page/home_page.dart';
import 'package:enjoy_plan/page/login_page.dart';
import 'package:enjoy_plan/page/route/router.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
      statusBarIconBrightness: Brightness.dark,
      statusBarBrightness: Brightness.dark,
      statusBarColor: Colors.blueAccent,
    ));
    return MaterialApp(
      routes: {
        RouteConstants.login.str: (context) => const LoginPage(),
        RouteConstants.home.str: (context) => const HomePage(),
      },
      debugShowCheckedModeBanner: false,
      title: 'LearnPath',
      localizationsDelegates: [
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
        AppLocalizationsDelegate(),
      ],
      supportedLocales: [const Locale('zh', 'CN'), const Locale('en', 'US')],
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        appBarTheme: AppBarTheme(
          backgroundColor: Colors.blueAccent,
        ),
        bottomAppBarTheme: BottomAppBarTheme(
          color: Colors.blueAccent,
        ),
        useMaterial3: true,
      ),
      home: const CustomPageTwoWidget(),
    );
  }
}
